CREATE TABLE [dbo].[TTDOCC_ANUL]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_CLIE] [dbo].[TD_VC_020] NOT NULL,
[CO_TIPO_DOCU] [dbo].[TD_VC_003] NOT NULL,
[NU_DOCU_CLIE] [dbo].[TD_VC_020] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[FE_ANUL] [dbo].[TD_DT_001] NOT NULL,
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TTDOCC_AN__ST_CO__43CBF196] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTDOCC_AN__NU_PR__45B43A08] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTDOCC_AN__CO_US__46A85E41] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTDOCC_AN__FE_US__479C827A] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTDOCC_AN__CO_US__4890A6B3] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTDOCC_AN__FE_US__4984CAEC] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTDOCC_ANUL] WITH NOCHECK ADD CONSTRAINT [CK__TTDOCC_AN__ST_CO__44C015CF] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TTDOCC_ANUL] ADD CONSTRAINT [PK__TTDOCC_A__F95F03362922E852] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_CLIE], [CO_TIPO_DOCU], [NU_DOCU_CLIE]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTDOCC_ANUL] ADD CONSTRAINT [FK__TTDOCC_ANUL__5556704B] FOREIGN KEY ([CO_EMPR], [CO_CLIE], [CO_TIPO_DOCU], [NU_DOCU_CLIE]) REFERENCES [dbo].[TMDOCU_CLIE] ([CO_EMPR], [CO_CLIE], [CO_TIPO_DOCU], [NU_DOCU_CLIE])
GO
ALTER TABLE [dbo].[TTDOCC_ANUL] ADD CONSTRAINT [FK__TTDOCC_ANUL__54624C12] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
